package tech.aistar.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tech.aistar.entity.Quiz;
import tech.aistar.entity.Register;

import java.util.List;


public interface RegisterMapper {

    @Select("select * from register where id=#{id}")
    Register selectById(Integer id);

    @Select("select * from register where account=#{account}")
    Register selectByAccount(String account);

    @Select("select * from register")
    List<Register> selectAll();

    @Select("select password from register where account=#{account}")
    Register selectPassword(String account);

    @Update("update register set password=#{pwd} where id=#{id}")
    int updateById(@Param("id") Integer id,@Param("pwd") String password);

    @Insert("insert into register(account,password,identity) value(#{account},#{password},#{identity})")
    void insert(Register register);
}
